#coding:utf-8
#python多进程
import multiprocessing

num = multiprocessing.Value('i', 0)
def worker_with(num):
    while num.value<100000:
     num.value=num.value+1
     print num.value


if __name__ == "__main__":
    process=[]
    for i in range(5):
        w = multiprocessing.Process(target=worker_with,args=(num,))
        process.append(w)
    for p in process:
        p.start()
    for p in process:
        p.join()
    print num.value